Provide APD access over thin client#2737
Conversation
|
Is this not already handled by getObject mdsplus/python/MDSplus/connection.py Line 321 in ad08c9c |
|
getObject() forces serialization/deserialization. get() and put() are more general and apply serialization only when required, and transparently to the user, keeping at the same time compatibility with the old mdsip servers and presenting the same interface and semantic of C++ and Java (they do not have getObject()). |
|
why not adding a putObject() which would do serialization under the hood instead of tempering with get and put |
|
There is indeed not a real need in the python interface to change the behavior of get() and put() , being getObject() also available (unlike C++ and Java). The real need was in Java because of the use of MATLAB structured data. |
|
so why not adding getObject to the other interfaces instead. |
|
Not feasible without a big effort. The reason is that MATLAB access at TCV goes through thin client via get() and they need full support for MATLAB (arrays of) structures. Defining getObject() in Java and going through it would require deeply changing all the MATLAB and Java support. It took a lot of time have it working and sincerely I prefer rather leaving things as they are now. |
|
Forgot to say: and in any case the equivalent of putObject is missing in the alpha version. In this branch, put() sends serialized data only if APD are present. |
|
Sorry, things come in my mind once a time....the reason why get() performs serialization is that we may not know in advance whether the result of the expression is an APD or not. So it is not possible to know in advance whether using getObject() or get() when retrieving data in thin client |
|
I get that .. hence you would use |
|
It is a bit more complicated.....there are use cases in which the type of the data being read is not known in advance, but discovered after having been read it (e.g. when introspecting some data). This means that we don't know whether using get() or getObject() in advance. This is the reason why get() has been made in this branch general enough to be able to read any data, including APD. |
|
After working with the internals of the python API and thin client a lot over the past few weeks, I second Timo's comments. I think we should provide new methods for accomplishing these tasks, but I don't like the idea of serializing all .get()'s and some .put()'s by default. |
|
Closing due to inactivity |
Rebased on Alpha, introduces the management of APD access over thin client for python. Checked also against older mdsip servers.